package com.dongdong.api;

import com.dongdong.model.TbAddress;
import com.dongdong.model.TbUser;
import com.dongdong.utils.Result;
import com.dongdong.vo.AddressVO;
import com.dongdong.vo.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@FeignClient("dongdong-user-service")
public interface UserApi {


    @PostMapping("/user/register")
    public Result register(@RequestBody UserVO user);

    @GetMapping("/address/getAddressByUserId")
    public List<AddressVO> getAddressByUserId(@RequestHeader String accessToken);

    @GetMapping("/address/getAddressById")
    public TbAddress getAddressById(@RequestParam Long addrId);

    @PostMapping("/address/addAddress")
    public void addAddress(@RequestHeader String accessToken,@RequestBody AddressVO addressVO);
}
